﻿<%@ Page Language="C#" MasterPageFile="~/DigitalTV.Master" AutoEventWireup="true" CodeBehind="ManterVendaPacote.aspx.cs" Inherits="UI.ManterVendaPacote" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="dados" class="divDados" style="width:400px">
    <table cellspacing="0" class="tabela">
    <tr class="header">
    <td class="header ">CLIENTE</td>
    <td  class="header "></td>
    <td  class="header ">PACOTE</td>
    </tr>
    <tr>
    <td>
        <asp:DropDownList ID="ddlCliente" runat="server" AppendDataBoundItems="True" 
            DataSourceID="SqlDataSourceCliente" DataTextField="tx_nome" 
            DataValueField="tx_nome">
            <asp:ListItem>Selecionar...</asp:ListItem>
        </asp:DropDownList>
        <asp:SqlDataSource ID="SqlDataSourceCliente" runat="server" 
            ConnectionString="<%$ ConnectionStrings:DIGITALTVConnectionString %>" 
            SelectCommand="SELECT DISTINCT [tx_nome] FROM [T_Cliente]">
        </asp:SqlDataSource>
    </td>
    <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
        &nbsp;</td>
    <td>
        <asp:DropDownList ID="ddlPacote" runat="server" AppendDataBoundItems="True" 
            DataSourceID="SqlDataSourcePacote" DataTextField="tx_Nome" 
            DataValueField="nr_IdPacote">
            <asp:ListItem Value="Selecione...">Selecione...</asp:ListItem>
        </asp:DropDownList>
        <asp:SqlDataSource ID="SqlDataSourcePacote" runat="server" 
            ConnectionString="<%$ ConnectionStrings:DIGITALTVConnectionString %>" 
            SelectCommand="SELECT DISTINCT [nr_IdPacote], [tx_Nome] FROM [T_Pacote]">
        </asp:SqlDataSource>
    </td>
    </tr>
    <tr>
    <td valign="top">
        PREÇO R$:
        <asp:TextBox ID="txtPreço" runat="server"></asp:TextBox>
        <cc1:MaskedEditExtender ID="txtPreço_MaskedEditExtender" runat="server" 
            AutoCompleteValue="00" ClearMaskOnLostFocus="False" CultureAMPMPlaceholder="" 
            CultureCurrencySymbolPlaceholder="" CultureDateFormat="" 
            CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureName="pt-BR" 
            CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
            Mask="999.99" MaskType="Number" PromptCharacter="" TargetControlID="txtPreço">
        </cc1:MaskedEditExtender>
    </td>
    <td>&nbsp;</td>
    <td>
        DATA DA VENDA:<asp:TextBox ID="txtData" runat="server"></asp:TextBox>
        <cc1:MaskedEditExtender ID="txtData_MaskedEditExtender" runat="server" 
            AcceptAMPM="True" AutoCompleteValue="00" ClearMaskOnLostFocus="False" 
            CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" 
            CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
            CultureName="pt-BR" CultureThousandsPlaceholder="" CultureTimePlaceholder="" 
            Enabled="True" Mask="99/99/9999" MaskType="Date" TargetControlID="txtData" 
            UserDateFormat="DayMonthYear">
        </cc1:MaskedEditExtender>
    &nbsp;</td>
    </tr>
    <tr>
    <td valign="top">
        USUARIO ATENTENDENTE<asp:DropDownList ID="ddlUsuario" runat="server" 
            DataSourceID="SqlDataSourceUsuario" DataTextField="tx_login" 
            DataValueField="tx_login">
        </asp:DropDownList>
        <asp:SqlDataSource ID="SqlDataSourceUsuario" runat="server" 
            ConnectionString="<%$ ConnectionStrings:DIGITALTVConnectionString %>" 
            SelectCommand="SELECT DISTINCT [tx_login] FROM [T_Usuarios]">
        </asp:SqlDataSource>
        <br />
    </td>
    <td>&nbsp;</td>
    <td>
        &nbsp;</td>
    </tr>
    <tr>
    <td colspan="3" align="right">
        <br />
        <br />
        <asp:Button ID="Button1" CssClass="btn" runat="server" Text="Salvar" 
            onclick="Button1_Click" />
    </td>
    </tr>
    </table>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:GridView ID="GridView1" h runat="server" CellPadding="4" ForeColor="#333333" 
                    GridLines="None" AllowPaging="True" AllowSorting="True" 
                    AutoGenerateColumns="False" DataSourceID="LinqDataSource1">
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    <Columns>
                        <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                        <asp:BoundField DataField="Id" HeaderText="Id" SortExpression="Id" />
                        <asp:BoundField DataField="Cliente" HeaderText="Cliente" 
                            SortExpression="Cliente" />
                        <asp:BoundField DataField="Usuario" HeaderText="Usuario" 
                            SortExpression="Usuario" />
                        <asp:BoundField DataField="Data" HeaderText="Data" 
                            SortExpression="Data" />
                        <asp:BoundField DataField="Preco" HeaderText="Preco" 
                            SortExpression="Preco" />
                        <asp:BoundField DataField="Pacote" HeaderText="Pacote" 
                            SortExpression="Pacote" />
                    </Columns>
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <EmptyDataTemplate>
                        <asp:Label ID="Label1" runat="server" ForeColor="Blue" Text="Nenhum item encontrado"></asp:Label>
                    </EmptyDataTemplate>
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <EditRowStyle BackColor="#999999" />
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    
                </asp:GridView>
                <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
                    ContextTypeName="Dados_.DigitalTVContextDataContext" EnableDelete="True" 
                    EnableUpdate="True" TableName="VendaVOs">
                </asp:LinqDataSource>
            </ContentTemplate>
        
        
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
            </Triggers>
        
        
        </asp:UpdatePanel>
    
    
    
    <br />
    
    
    
            <br />
            <br />
    
    
    
    </div>
</asp:Content>